gl: Track the current uniform state for custom programs
authorAlexander Larsson <alexl@redhat.com>
Tue, 29 Sep 2020 09:52:39 +0000 (11:52 +0200)
committerAlexander Larsson <alexl@redhat.com>
Tue, 29 Sep 2020 09:52:39 +0000 (11:52 +0200)
commit51ab56d33aa158cac0a0cc03fa2828807729cda1
tree3e0b97a121d69f4d09098a1524f9cb154d529c8e
parent2e5caa68bc5b37fdf1b808b304c6d5499f21ab48
gl: Track the current uniform state for custom programs

This allows us to avoid updating uniforms if that is not necessary. This
in turn allows us to sometimes reuse the same draw op by just extending the
vertex array size we draw rather than doing a separate glDraw call.

For example, in the fishbowl demo, all the icons added at the same
time will have the same time and size, so we emit single draw calls
with 100s of triangles instead of 100s of draw calls with 2 triangles.
gsk/gl/gskglrenderops.c
gsk/gl/gskglrenderopsprivate.h